import numpy as np
import matplotlib.pyplot as plt

def sigmoid(x):
    return 1 / (1 + np.exp(-x + 5))
def step_function(x):
    return np.array(x > 4)

x = np.linspace(0, 2*np.pi, 128)
# series_1 = np.sin(x) * 10
series_1 = np.sin(x) * 10
nan_indices = np.random.choice(len(x), 20, replace=False)  # Introduce missing values
series_1[nan_indices] = np.nan
series_2 = np.cos(x) * 5 + 5
error_indices = np.random.choice(len(x), 5, replace=False)  # 随机选择5个数据点
series_2[error_indices] = 20  # 设置这些数据点的值为20（或任何异常值）

# series_3 = (np.sin(x+2) + np.cos(x+2)) * 6  # This is the same as series_1
# Adding significant noise to series_3
noise = np.random.normal(0, 3, len(x))  # Generate noise
series_3 = (np.sin(x+2) + np.cos(x+2)) * 6 + noise

# series_4 = (np.sin(x*5) + np.cos(x*5)) * 5
plt.figure(figsize=(12, 6))
plt.plot(x, series_1, label='sin(x) * 10', linewidth=3.0, color='#4B5845')
plt.plot(x, series_2, label='cos(x) * 10', linewidth=3.0, color='#9BB897')
plt.plot(x, series_3, label='sigmoid', linewidth=3.0, color='#68926E')
# plt.plot(x, series_4, label='(sin(x) + cos(x)) * 5', linewidth=3.0, color='#71A787')
plt.xticks([])
plt.yticks([])
plt.savefig("seq.png")
